package com.ysd.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.fasterxml.jackson.annotation.JsonIgnore;

//角色
@Entity
public class Roles {

	@Id
	private String Id;//角色编号
	private String Name;//角色名称 
	 private  Integer Int0; 
	private String String0;//备用2
	
	
	
	 @JsonIgnore
	 @ManyToMany(fetch=FetchType.EAGER) 
	 @JoinTable(
	 			name="rolemodules",//指定中间表的表名
	 			joinColumns= {@JoinColumn(name="roleid")},//维护方实体的外键 
	 			inverseJoinColumns= {@JoinColumn(name="moduleid")}//被维护方实体的主键 
	 			)
	 private List<Modules> modules;
 


	public String getId() {
		return Id;
	}



	public void setId(String id) {
		Id = id;
	}



	public String getName() {
		return Name;
	}



	public void setName(String name) {
		Name = name;
	}



	public String getString0() {
		return String0;
	}



	public void setString0(String string0) {
		String0 = string0;
	}



	public List<Modules> getModules() {
		return modules;
	}



	public void setModules(List<Modules> modules) {
		this.modules = modules;
	}



	public Roles(String id, String name, String string0, List<Modules> modules) {
		super();
		Id = id;
		Name = name;
		String0 = string0;
		this.modules = modules;
	}



	public Roles() {
		super();
		// TODO Auto-generated constructor stub
	}

} 
